<?php include("../Service/WebClass/admin/KeyWordClass.php");
$keyword = new KeyWord;
$keyword->MyTask();
?> 





<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>キーワード別集計分析</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/common.css" type="text/css" />
<script language="JavaScript" src="../js/common.js" type="text/javascript"></script>
<script language="JavaScript" src="../js/Calendar4.js" type="text/javascript"></script>
<script>
function do_csv()
{
	document.getElementById("act").value = "csv";
	document.getElementById("mainform").submit();	
}
function do_search(actValue)
{
	if(document.getElementById("search_detail").style.display != "none")
	{
		if(checkFilter() == false)
		{
			alert("整数値を入力してください。");
			return false;
		}		
	}
	document.getElementById("act").value = actValue;
	// 詳細検索状態をセットする
	if(document.getElementById("search_detail").style.display == "none")
	{
		// 詳細検索は非表示の場合
		document.getElementById("search_detail_hid").value = "display:none";
	}
	else
	{
		// 詳細検索は表示の場合
		document.getElementById("search_detail_hid").value = null;
	}
	document.getElementById("mainform").submit();	
}

function checkFilter()
{
	var regexs = /^[1-9]+[0-9]*$/;
	if(document.getElementById("filter_value").value != "" && document.getElementById("filter_value").value != "")
	{
		var result1 = regexs.test(document.getElementById("filter_value").value);
		if(result1 == false)
		{
			return false;
		}		
	}
	if(document.getElementById("filter3_value").value != "" && document.getElementById("filter3_value").value != "")
	{
		var result3 = regexs.test(document.getElementById("filter3_value").value);
		if(result3 == false)
		{
			return false;
		}
	}
	if(document.getElementById("filter2_value").value != "" && document.getElementById("filter2_value").value != "")
	{
		var result2 = regexs.test(document.getElementById("filter2_value").value);
		if(result2 == false)
		{
			return false;
		}
	}	
	return true;
}
</script>

</head>
<body bgcolor="#F4FFE4">
<?php include("../head.php");?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">

 <tr>
    <td width="165" valign="top" bgcolor="#5C743D"><?php include("../adminMenu.php");?>
    <form name="mainform" id="mainform" method="post">
    <div class="sidemenu1">表示形式</div>

<input type=hidden id="nowPage" name="nowPage" value="1">
<input type=hidden id="keywordIdList" name="keywordIdList">			
<div class="sidemenu4">
	<input name="report_axis" id="axis_id" value="id" onclick="javascript:document.getElementById('nowPage').value = 1;do_search('submit');" type="radio"><label for="axis_id">キーワード別</label><br>
	<input name="report_axis" id="axis_d" value="d" onclick="javascript:document.getElementById('nowPage').value = 1;do_search('submit');" type="radio"><label for="axis_d">日別</label><br>	
	<input name="report_axis" id="axis_w" value="w" onclick="javascript:document.getElementById('nowPage').value = 1;do_search('submit');" type="radio"><label for="axis_w">週別</label><br>
	<input name="report_axis" id="axis_dow" value="dow" onclick="javascript:document.getElementById('nowPage').value = 1;do_search('submit');" type="radio"><label for="axis_dow">曜日別</label><br>
	<input name="report_axis" id="axis_m" value="m" onclick="javascript:document.getElementById('nowPage').value = 1;do_search('submit');" type="radio"><label for="axis_m">月別</label><br>
	<script>
	var list = document.getElementsByName("report_axis");
	var i;
	for(i=0;i<list.length;i++)
	{
		if(list[i].value == "<?php echo $keyword->reportAxis;?>")
		{
			list[i].checked = true;
			break;
		}
	}
	</script>	
</div>
    </td>
    <td width="813" colspan="2" align="center" valign="top">
<?php
echo "<input type=hidden name=act id=act value=submit>"
?>     
      <!-- search_area start -->
<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tbl where">
	<tr>
		<td>

			<input type="text" name="from_date" id="cal_input_from" value="<?php echo $keyword->fromDate;?>" class="txBox" style="width: 65px;">
<a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(getObjById('cal_input_from'));return false;" HIDEFOCUS>
<img name="popcal2" align="top" src="../images/cal.gif" border="0" alt="calendar" onclick="MyCalendar.SetDate(this,document.getElementById('cal_input_from'))"></a>
-
<input type="text" name="to_date" id="cal_input_to" value="<?php echo $keyword->toDate;?>" class="txBox" style="width: 65px;">
<a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fPopCalendar(getObjById('cal_input_to'));return false;" HIDEFOCUS>
<img name="popcal2" align="top" src="../images/cal.gif" border="0" alt="calendar" onclick="MyCalendar.SetDate(this,document.getElementById('cal_input_to'))"></a>
&nbsp;&nbsp;
<input type="button" class="btn search" onclick="javascript:document.getElementById('nowPage').value = 1;do_search('submit');">
&nbsp;&nbsp;
<input type="button" class="btn btn_wider" value="▼詳細検索..." 
            onclick="openCloseSearchDetail()">
		</td>
	</tr>
	<tr id="search_detail" style="<?php echo $keyword->searchDetailHid?>">
	<input type=hidden name=search_detail_hid id=search_detail_hid>		
		<td><select name="search_col" id="search_col" class="txBox">
	<option value="key_Id" >キーワードID
	<option value="text">キーワード
</select>
<script>document.getElementById("search_col").value = "<?php echo $keyword->searchCol;?>";</script>			
<input type="text" name="search_text" size="35" maxlength="100" value="<?php echo $keyword->searchText;?>" class="txBox">

<select name="search_type" id="search_type" class="txBox">
	<option value="0">全部一致
	<option value="1" >部分一致
</select>
<script>document.getElementById("search_type").value = "<?php echo $keyword->searchType?>";</script>			
&nbsp;&nbsp;
<br><img src="../images/spacer.gif" width="1" height="5" border="0"><br>
<select name="filter_col" id="filter_col" class="txBox">
<option value="impression" >Imp
<option value="clickCnt" >Click
<option value="ctr" >CTR[%]
<option value="cpc" >CPC[円]
<option value="cost" >コスト[円]
<option value="cv" >CV
<option value="cvr" >CVR[%]
<option value="cpa" >CPA[円]
<option value="cpm" >CPM[円]
<option value="roas" >ROAS[円]
<option value="sales" >売上[円]
<option value="salesValue" >売上単価[円]
<option value="directCvCnt" >直接
<option value="indirectCvCnt" >間接
<option value="asistCvCnt" >アシスト
<option value="postCvCnt" >ポスト効果
<option value="position" >平均順位
</select>
<script>document.getElementById("filter_col").value = "<?php echo $keyword->filterCol;?>"</script>
<input type="text" name="filter_value" id="filter_value" size="10" maxlength="10" value="<?php echo $keyword->filterValue;?>" class="txBox">
<select name="filter_type" id="filter_type" class="txBox">
	<option value="1" >以上
	<option value="2" >以下
</select>
<script>document.getElementById("filter_type").value = "<?php echo $keyword->filterType;?>";</script>			
&nbsp;&nbsp;
<select name="filter3_col" id="filter3_col" class="txBox">
<option value="impression" >Imp
<option value="clickCnt" >Click
<option value="ctr" >CTR[%]
<option value="cpc" >CPC[円]
<option value="cost" >コスト[円]
<option value="cv" >CV
<option value="cvr" >CVR[%]
<option value="cpa" >CPA[円]
<option value="cpm" >CPM[円]
<option value="roas" >ROAS[円]
<option value="sales" >売上[円]
<option value="salesValue" >売上単価[円]
<option value="directCvCnt" >直接
<option value="indirectCvCnt" >間接
<option value="asistCvCnt" >アシスト
<option value="postCvCnt" >ポスト効果
<option value="position" >平均順位
</select>
<script>document.getElementById("filter3_col").value = "<?php echo $keyword->filter3Col;?>";</script>
<input type="text" name="filter3_value" id="filter3_value" size="10" maxlength="10" value="<?php echo $keyword->filter3Value;?>" class="txBox">
<select name="filter3_type" id="filter3_type" class="txBox">
	<option value="1" >以上
	<option value="2" >以下
</select>
<script>document.getElementById("filter3_type").value = "<?php echo $keyword->filter3Type;?>";</script>	
<select name="filter2_col" id="filter2_col" class="txBox">
	<option value="sponsored_maxbid" >入札額
</select>
<script>document.getElementById("filter2_col").value = "<?php echo $keyword->filter2Col;?>";</script>		
<input type="text" name="filter2_value" id="filter2_value" size="10" maxlength="10" value="<?php echo $keyword->filter2Value;?>" class="txBox">	
<select name="filter2_type" id="filter2_type" class="txBox">
	<option value="1" >以上
	<option value="2" >以下
</select>
<script>document.getElementById("filter2_type").value = "<?php echo $keyword->filter2Type;?>";</script>	
&nbsp;&nbsp;
<br><img src="view/images/spacer.gif" width="1" height="5" border="0"><br>
<?php echo "<input type=hidden name=isMediaSelectClick id=isMediaSelectClick value=0>"?>		
媒体
<select name="search_media_select" id="search_media_select" onchange="javascript:document.getElementById('nowPage').value = 1;document.getElementById('isMediaSelectClick').value=1;do_search('submit');" class="txBox">
	<option value="0" >(指定なし)
	<?php echo $keyword->mediaOptionList;
	?>
</select>
<script>document.getElementById("search_media_select").value = "<?php echo $keyword->searchMediaSelect;?>"</script>				
&nbsp;&nbsp;

キャンペーン
<select name="search_campaign_select" id="search_campaign_select" onchange="javascript:document.getElementById('nowPage').value = 1;document.getElementById('act').value = 'getGroup';do_search('getGroup');" class="txBox">
	<option value="0" >(指定なし)
	<?php echo $keyword->campaignOptionList;?>
	</select>
<script>document.getElementById("search_campaign_select").value = "<?php echo $keyword->searchCampaignSelect;?>"</script>		
&nbsp;&nbsp;
広告グループ
<select name="search_banner_select" id="search_banner_select" onchange="javascript:document.getElementById('nowPage').value = 1;do_search('submit');" class="txBox">
	<option value="0" >(指定なし)
	<?php echo $keyword->adgroupOptionList;?>
	</select>
<script>document.getElementById("search_banner_select").value = "<?php echo $keyword->searchBannerSelect;?>"</script>				
&nbsp;&nbsp;
同期状態
<select name="search_sync" id="search_sync" onchange="javascript:document.getElementById('nowPage').value = 1;do_search('submit');" class="txBox">
	<option value="0">(指定なし)
	<option value="2" >更新待ち
	<option value="1" >同期済
	<option value="3" >エラー
</select>
<script>document.getElementById("search_sync").value = "<?php echo $keyword->searchSync;?>"</script>		
		</td>
	</tr>
</table>
<!-- search_area end -->
<span id="backGroup" style="display:none;">
<a href="javascript:var id=document.getElementById('search_campaign_select').value;var fromDate=document.getElementById('cal_input_from').value;var toDate=document.getElementById('cal_input_to').value;window.location='adGroup.php?campaignId='+ id+'&fromDate='+fromDate+'&toDate='+toDate;">
<img src="../images/branch_parent.gif" border=0>広告グループ別に戻る</a><br>
</span>					
<img src="../images/spacer.gif" width="1" height="5" border="0"><br>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr align="right">
			<span id="inputShowSpan" style="display:none;">
			<td align="left">
			<img src="../images/ico_graph.gif" border="0">
			<span class=input_title id="input_title"></td>
			</span>
			</span>			
			<script>
			var groupname = document.getElementById("search_banner_select").options[document.getElementById("search_banner_select").selectedIndex].text;
			if(document.getElementById("search_banner_select").value !="0")
			{
				document.getElementById("inputShowSpan").style.display = "block";
				document.getElementById("input_title").innerText = "[広告グループ]" + groupname;
			}
			</script>					
	</tr>
</table>	
<img src="view/images/spacer.gif" width="1" height="5" border="0"><br>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="tbl_clear">
	<tr height="30" valign="bottom">

		<td align="left">
			<img src="../images/ico_graph_line.gif" border="0">
			種類
			<select name="graph_type" id="graph_type" size="1" class="txBox" onchange="do_search();">
				<option value="0" selected>折れ線
				<option value="1" >分布図
			</select>
			<script>document.getElementById("graph_type").value = "<?php echo $keyword->graphType;?>"</script>	
			&nbsp				
			指標1
			<select name="graph_col1" id="graph_col1" size="1" class="txBox" onchange="do_search('submit');">
			<option value="impression" >Imp
			<option value="clickCnt" >Click
			<option value="ctr" >CTR[%]
			<option value="cpc" >CPC[円]
			<option value="cost" >コスト[円]
			<option value="cv" >CV
			<option value="cvr" >CVR[%]
			<option value="cpa" >CPA[円]
			<option value="cpm" >CPM[円]
			<option value="roas" >ROAS[円]
			<option value="sales" >売上[円]
			<option value="salesValue" >売上単価[円]
			<option value="directCvCnt" >直接
			<option value="indirectCvCnt" >間接
			<option value="asistCvCnt" >アシスト
			<option value="postCvCnt" >ポスト効果
			<option value="position" >平均順位
			</select>
			<script>document.getElementById("graph_col1").value = "<?php echo $keyword->graphCol1;?>"</script>				
			&nbsp;
			指標2
			<select name="graph_col2" id="graph_col2" size="1" class="txBox" onchange="do_search('submit');">
			<option value="impression" >Imp
			<option value="clickCnt" >Click
			<option value="ctr" >CTR[%]
			<option value="cpc" >CPC[円]
			<option value="cost" >コスト[円]
			<option value="cv" >CV
			<option value="cvr" >CVR[%]
			<option value="cpa" >CPA[円]
			<option value="cpm" >CPM[円]
			<option value="roas" >ROAS[円]
			<option value="sales" >売上[円]
			<option value="salesValue" >売上単価[円]
			<option value="directCvCnt" >直接
			<option value="indirectCvCnt" >間接
			<option value="asistCvCnt" >アシスト
			<option value="postCvCnt" >ポスト効果
			<option value="position" >平均順位
			</select>
			<script>document.getElementById("graph_col2").value = "<?php echo $keyword->graphCol2;?>"</script>
						&nbsp;&nbsp;
			グラフサイズ
			<select name="graph_size" id="graph_size" size="1" class="txBox" onchange="do_search('submit');">
				<option value="0">標準
				<option value="1">最大
				<option value="2">非表示
			</select>
			<script>document.getElementById("graph_size").value = "<?php echo $keyword->graphSize;?>"</script>												
		</td>
		<td align="right">
		<input type="button" class="btn_exp csv" title="CSV出力" value="" onclick="do_csv()"></td>

	</tr>
</table>
<div id="chart_area">
<?php
	// 初期化の場合、図は表示しない
	if($keyword->graphSize == "2")
	{
	}
	else
	{
		$src = "../Service/Graph/admin/KeyWordGraph.php?reportAxis=".$keyword->reportAxis."&fromDate=".$keyword->fromDate;
		$src = $src."&toDate=".$keyword->toDate."&searchDetail=".$keyword->searchDetailHid;
		$src = $src."&searchCol=".$keyword->searchCol."&searchText=".urlencode(trim($keyword->searchText))."&searchType=".$keyword->searchType;
		$src = $src."&searchUserId=".$keyword->searchUserId;		
		$src = $src."&filterCol=".$keyword->filterCol."&filterValue=".$keyword->filterValue."&filterType=".$keyword->filterType;
		$src = $src."&filter2Col=".$keyword->filter2Col."&filter2Value=".$keyword->filter2Value."&filter2Type=".$keyword->filter2Type;		
		$src = $src."&filter3Col=".$keyword->filter3Col."&filter3Value=".$keyword->filter3Value."&filter3Type=".$keyword->filter3Type;
		$src = $src."&searchMediaSelect=".$keyword->searchMediaSelect."&searchCampaignSelect=".$keyword->searchCampaignSelect."&searchBannerSelect=".$keyword->searchBannerSelect."&searchSync=".$keyword->searchSync."&graphType=".$keyword->graphType;
		$src = $src."&graphCol1=".$keyword->graphCol1."&graphCol2=".$keyword->graphCol2."&graphSize=".$keyword->graphSize."&showDeleted=".$keyword->showDeleted."&selectPoint=".$keyword->selectPoint;
		$src = $src."&nowPageNum=".$keyword->nowPageNum;
		// 検索結果がない場合
		//if($campaign->searchResult != null)
		//{
			//echo $src;
			echo "<img id=graph src=".$src.">";
		//}		
	}
?>
</div>
<br>
<table width="100%" border="0" cellpadding="2" cellspacing="0">
		<tr>

		<td align="left">
			<img src="../images/ico_summary.gif" border="0" />
ビュー
<select name="select_view" id="select_view" size="1" class="txBox" onchange="javascript:document.getElementById('nowPage').value = 1;do_search('submit');">
	<option value="1" selected>標準ビュー
	<option value="2" >コスト分析
		<option value="4" >コンバージョン
	</select>
<script>document.getElementById("select_view").value = "<?php echo $keyword->selectView;?>"</script>						
&nbsp;&nbsp;
<input type="checkbox" name="show_deleted" value="1" id="show_deleted" >
<?php if($_POST["show_deleted"] == "1")
	{
		echo "<script>document.getElementById('show_deleted').checked = true;</script>";
	}
?>		
<label for="show_deleted">削除済みも表示</label>		</td>
<td align="left" width="50px">	
<input type="button" class="btn refresh" onclick="do_search('submit');">
</td>	
</tr>
</table>
<script>
// 非指定なしの場合		
if(document.getElementById("search_banner_select").value != "0")
{
	document.getElementById("backGroup").style.display = "block";
}		
</script>
<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tbl">
<tr align="right" class="tr2">
<?php echo $keyword->tableList;?>
</table>

<table width="100%" border="0" cellpadding="2" cellspacing="0">
<tr align="right">
<td align="right">
<?php echo "<label id='fromToPage' name='fromToPage'>".$keyword->fromToRowHtml."</label>";?>     
<?php echo "<label id='memberInfoCount' name='memberInfoCount'>".$keyword->allRowHtml."</label>";?>
</td>
<td>
<?php echo $keyword->pageLinkHtml;?>
		</td>
</table><br>

</div><br>


</form>

<a name="input_area_top"></a>
<div id="input_area">
	</div>		<!-- end of main area -->
    <br />
    <br />
    </td>

  </tr>
 </table>

<?php include("../foot.php");?>
</body>
</html>
